package com.vhall.component.entity.rebroadcast;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 红包服务应用设置表
 * red_packet_setting
 *
 * @author yongzheng.xu
 */
@Data
@TableName("red_packet_setting")
public class RedPacketSettingEntity implements Serializable {
    /**
     * 红包服务应用设置ID（主键）
     *
     * @date 2021-02-25 10:27:54
     */
    @TableId(type = IdType.AUTO, value = "id")
    @JsonProperty(value = "id")
    private Long id;

    /**
     * PaaS应用ID
     *
     * @date 2021-02-25 10:27:54
     */
    @TableField("app_id")
    @JsonProperty(value = "app_id")
    private String appId;

    /**
     * 应用私钥
     *
     * @date 2021-02-25 10:27:54
     */
    @TableField("private_key")
    @JsonProperty(value = "private_key")
    private String privateKey;

    /**
     * 红包支付和剩余金额退还回调通知接口地址
     *
     * @date 2021-02-25 10:27:54
     */
    @TableField("pay_callback_url")
    @JsonProperty(value = "pay_callback_url")
    private String payCallbackUrl;

    /**
     * 获得红包回调通知接口地址
     *
     * @date 2021-02-25 10:27:54
     */
    @TableField("get_red_packet_callback_url")
    @JsonProperty(value = "get_red_packet_callback_url")
    private String getRedPacketCallbackUrl;

    /**
     * 红包领取超时时间，单位秒
     *
     * @date 2021-02-25 10:27:54
     */
    @TableField("valid_timeout")
    @JsonProperty(value = "valid_timeout")
    private Integer validTimeout;

    /**
     * 是否已删除 0 表示未删除 1 表示已删除
     *
     * @date 2021-02-25 10:27:54
     */
    private Integer deleted;

    /**
     * 创建时间
     *
     * @date 2021-02-25 10:27:54
     */
    @TableField("created_at")
    @JsonProperty(value = "created_at")
    private LocalDateTime createdAt;

    /**
     * 删除时间
     *
     * @date 2021-02-25 10:27:54
     */
    @TableField("deleted_at")
    @JsonProperty(value = "deleted_at")
    private LocalDateTime deletedAt;

    /**
     * 更新时间
     *
     * @date 2021-02-25 10:27:54
     */
    @TableField("updated_at")
    @JsonProperty(value = "updated_at")
    private LocalDateTime updatedAt;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table app_setting
     *
     * @date 2021-02-25 10:27:54
     */
    private static final long serialVersionUID = 1L;

    /**
     * @date 2021-02-25 10:27:54
     */
    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        RedPacketSettingEntity other = (RedPacketSettingEntity) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getAppId() == null ? other.getAppId() == null : this.getAppId().equals(other.getAppId()))
                && (this.getPrivateKey() == null ? other.getPrivateKey() == null : this.getPrivateKey().equals(other.getPrivateKey()))
                && (this.getPayCallbackUrl() == null ? other.getPayCallbackUrl() == null : this.getPayCallbackUrl().equals(other.getPayCallbackUrl()))
                && (this.getGetRedPacketCallbackUrl() == null ? other.getGetRedPacketCallbackUrl() == null : this.getGetRedPacketCallbackUrl().equals(other.getGetRedPacketCallbackUrl()))
                && (this.getValidTimeout() == null ? other.getValidTimeout() == null : this.getValidTimeout().equals(other.getValidTimeout()))
                && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()))
                && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
                && (this.getDeletedAt() == null ? other.getDeletedAt() == null : this.getDeletedAt().equals(other.getDeletedAt()))
                && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()));
    }

    /**
     * @date 2021-02-25 10:27:54
     */
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getAppId() == null) ? 0 : getAppId().hashCode());
        result = prime * result + ((getPrivateKey() == null) ? 0 : getPrivateKey().hashCode());
        result = prime * result + ((getPayCallbackUrl() == null) ? 0 : getPayCallbackUrl().hashCode());
        result = prime * result + ((getGetRedPacketCallbackUrl() == null) ? 0 : getGetRedPacketCallbackUrl().hashCode());
        result = prime * result + ((getValidTimeout() == null) ? 0 : getValidTimeout().hashCode());
        result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        result = prime * result + ((getDeletedAt() == null) ? 0 : getDeletedAt().hashCode());
        result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
        return result;
    }

    /**
     * @date 2021-02-25 10:27:54
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", settingId=").append(id);
        sb.append(", appId=").append(appId);
        sb.append(", privateKey=").append(privateKey);
        sb.append(", payCallbackUrl=").append(payCallbackUrl);
        sb.append(", getRedPacketCallbackUrl=").append(getRedPacketCallbackUrl);
        sb.append(", validTimeout=").append(validTimeout);
        sb.append(", deleted=").append(deleted);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", deletedAt=").append(deletedAt);
        sb.append(", updatedAt=").append(updatedAt);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}